from collectCube import CollectCube

class ExtraFast(CollectCube):
    
    def __init__(self):
        CollectCube.__init__(self)
        
        self.boost = 1.50
        self.oldWalk = 0
        self.oldJump = 0
        
        self.setVar("texture", "extraFast")
        
        self.setVar("timedItem", True)
        self.setVar("lifeSpan", 7)
        self.setVar("lifeBlinkTime", 1)
        
    def onPickUp(self, player):
        self.oldWalk = player.getVar("walk")
        self.oldJump = player.getVar("jump")
        
        player.setVar("walk", self.oldWalk * self.boost)
        player.setVar("jump", self.oldJump * self.boost)
        
    def onDropped(self, player):
        player.setVar("walk", self.oldWalk)
        player.setVar("jump", self.oldJump)